<?php

namespace App\Repositories;

use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Repositories\DormRatingMainRepository;
use App\Models\DormRatingMain;
use App\Validators\DormRatingMainValidator;

/**
 * Class DormRatingMainRepositoryEloquent.
 *
 * @package namespace App\Repositories;
 */
class DormRatingMainRepositoryEloquent extends BaseRepository implements DormRatingMainRepository
{
    /**
     * Specify Model class name
     *
     * @return string
     */
    public function model()
    {
        return DormRatingMain::class;
    }

    /**
     * Specify Validator class name
     *
     * @return mixed
     */
    public function validator()
    {

        return DormRatingMainValidator::class;
    }
    protected $fieldSearchable = [
        'dorm.code' => 'like',
        'period.id',
        'dorm.building.id',
    ];


    /**
     * Boot up the repository, pushing criteria
     */
    public function boot()
    {
        $this->pushCriteria(app(RequestCriteria::class));
    }
}
